#include "PowerDevice.h"
#include <string.h>
#pragma warning(disable : 4996)

PowerDevice::PowerDevice(const char *name,const char * muscles):
Device(name) , mainMuscles(NULL)
{
setmainMuscles(muscles);
}

PowerDevice::~PowerDevice(void)
{
	delete []mainMuscles;
}

void PowerDevice::setmainMuscles(const char *name)
{
	delete[]mainMuscles;
	mainMuscles = strdup(name);
}
const  PowerDevice&    PowerDevice:: operator=  (const PowerDevice& other)
{
	if (this != &other)
	{
		this->setmainMuscles(other.mainMuscles);
		strcpy(this->name,other.name);
		this->idNumber = other.getIdNumber();
	}

	return *this;
}

const char*	PowerDevice::getMainMuscles() const 
{
	return this->mainMuscles;
}

ostream & operator<<(ostream & os,const PowerDevice & D) //#WD[3] RonnyR 12.12
{
os<<(Device&)D<<" (Power Device) , ";
os<<"Main Muscles: "<<D.mainMuscles<<endl;
return os;
}
Device * PowerDevice::Clone() const
{

return new PowerDevice(*this);
}

void PowerDevice::showSafetyInstructions() const
{
}

void PowerDevice::PrintDevice(ostream & os) const
{
os<<*this;
}